home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 10
/
The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso
/
PC_SIGCD
/
05
/
6
/
DISK0564.ZIP
/
SOURCE.ARC
/
B.ARC
/
BIOS.AS
< prev
next >
Wrap
Text File
|
1986-02-23
|
1KB
|
48 lines
; general-purpose bios gate
; written for Aztec C86 v. 3.20e
; by Jon Dart, Feb. 1986
MODEL equ 0 ;small code, small data
include lmacros.h
; bios(interrupt,function,regptr)
; /* sets ah=function #, calls bios, returns regs */
; int interrupt, function; struct regs *regptr;
; /* regptr is a pointer to a struct:
; struct regs {
; unsigned int ax,bx,cx,dx;
; }; */
codeseg segment
procdef bios,<<arg1,word>,<arg2,word>,<arg3,ptr>>
pushds
push ds
mov ax,cs
mov ds,ax ;temporarily make data seg = code seg
mov ax,arg1 ;get 1st arg = interrupt vector
mov byte ptr ds:(intins+1),al ;stick vector into int instruction
pop ds ;restore data seg
push si
mov ax,arg2 ;get 2nd argument = function #
mov ah,al ;function # in ah
ldptr si,arg3 ;get 3rd argument = pointer to structure.
mov al,[si] ;load al from reg structure
mov bx,[si+2] ;then bx
mov cx,[si+4] ;then cx
mov dx,[si+6] ;then dx
intins:
int 0 ;call bios
mov [si],ax ;put results into struct
mov [si+2],bx
mov [si+4],cx
mov [si+6],dx
pop si
popds
pret ;return to caller
pend bios
finish
codeseg ends
end